<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Echart Bar Chart Example</title>
    <!-- 引入 Echart 库 -->
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.4.2/echarts.min.js"></script>
</head>
<body>
    <!-- 容器元素 -->
    <div id="chart-container" style="width: 600px;height:400px;"></div>
    <!-- JavaScript 代码 -->
    <script>
        // 初始化 Echart 实例
        var chart = echarts.init(document.getElementById('chart-container'));
         // 配置项
        var option = {
            title: {
                text: 'Bar Chart Example'
            },
            tooltip: {},
            legend: {
                data:['Sales']
            },
            xAxis: {
                data: ["张三", "李四", "王五", "赵六", "天气"]
            },
            yAxis: {},
            series: [{
                name: 'Sales',
                type: 'bar',
                data: [50, 80, 120, 70, 90]
            }]
        };
         // 使用配置项生成图表
        chart.setOption(option);
    </script>
</body>
</html>